package com.icxcc.icxoauth.api;

import com.icxcc.common.util.R;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("userapi")
public class UserApi {
    @GetMapping("me")
    public R me(Authentication authentication){
        UserDetails user = (UserDetails) authentication.getPrincipal();
        return R.OK(user);
    }
}
